package com.puhui.lib.base

import android.os.Bundle
import androidx.databinding.ViewDataBinding
import com.puhui.lib.base.mvp.IPresenter

abstract class MvpBaseActivity<T : ViewDataBinding, P : IPresenter> : BaseActivity<T>() {

    lateinit var mPresenter: P

    override fun onCreate(savedInstanceState: Bundle?) {
        mPresenter = createPresenter()
        lifecycle.addObserver(mPresenter)
        super.onCreate(savedInstanceState)
    }

    abstract fun createPresenter(): P
}